import ajax, { ResDataType } from "./ajax";

export async function getStatListServices(
  questionId: string,
  opt: { page: number; pageSize: number }
): Promise<ResDataType> {
  const url = "/api/stat/" + questionId;
  const data = (await ajax.get(url, { params: opt })) as ResDataType;
  return data;
}

export async function getChartStatServices(
  questionId: string,
  componentId: string
): Promise<ResDataType> {
  const url = "/api/stat/chart/" + questionId + "/" + componentId;
  const data = (await ajax.get(url)) as ResDataType;
  return data;
}
